import React, { Component } from 'react'

export default class Child extends Component {

    state = {
        // person:[
        //     {name:'小明',age:10},
        //     {name:'大明',age:31},
        //     {name:'小红',age:16},
        // ]
         person: 'hh'
    }

    render() {
        return (
            <div>
                <h2>我是子组件</h2>
                {
                    this.state.person.map(ele=>{
                    return <li>{ele.name}--{ele.age}</li>
                    })
                }
            </div>
        )
    }
}

